package com.senlingspace.common.enums;

public enum RelatedType {
    // INVESTOR=投资方、PROJECT=项目、TICKET_SYSTEM=票务、OPERATION=运营
    INVESTOR("INVESTOR","投资方"),
    PROJECT("PROJECT","项目"),
    TICKET_SYSTEM("TICKET_SYSTEM","票务"),
    OPERATION("OPERATION","运营");

    private final String code;
    private final String description;

    RelatedType(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static RelatedType fromCode(String code) {
        for (RelatedType source : RelatedType.values()) {
            if (source.getCode() == code) {
                return source;
            }
        }
        throw new IllegalArgumentException("Unknown code: " + code);
    }

    @Override
    public String toString() {
        return description;
    }
}
